<include file="nav:headr"/>
<div class="container">
    <div class="row">
        <div style="height: 30px"></div>
        <div class="col-md-2">
            <include file="Content:sider"/>
        </div>
        <div class="col-md-10">
            <div class="page-header">
                <h4>{$page_title}</h4>
            </div>
            <div class="btn-group" role="group" aria-label="...">
                <a  href="{:U('Tag/index')}" type="button" class="btn btn-default">بارلىق خەتكۈچلەر</a>
                <a href="{:U('Tag/add')}" type="button" class="btn btn-default">يېڭىدىن قوشۇش</a>
            </div>
            <br>
            <br>
            <!-- Single button -->
            <foreach name="tags" item="t">
                <div class="btn-group" style="margin: 0 0 7px 7px">
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        {$t['tname']}<span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu">
                        <li><a href="{:U('Tag/edit',array('tid'=>$t['tid']))}">تەھرىرلەش</a></li>
                        <li><a href="Javascript:deleteTag({$t['tid']}) ;">ئۆچۈرۈش</a></li>
                    </ul>
                </div>
            </foreach>
        </div>
    </div>
</div>
<script type="text/javascript">
    function deleteTag(tid) {
        //询问框
        layer.confirm('راستىنلا ئۆچۈرەمسىز？', {
            btn: ['ھەئە','ياق'] //按钮
        }, function(){
            $.ajax({
                'url':"{:U('Tag/deleteSort')}",
                'type':'POST',
                'dataType':'json',
                'data':{'tid':tid},
                success:function (phpRetrnData) {
                    if(phpRetrnData.status){
                        layer.msg(phpRetrnData.massage,{'icon':6},function () {
                            window.location=location;
                        })
                    }else {
                        layer.msg(phpRetrnData.massage,{'icon':5});
                    }
                }
        });
    })
    }
</script>
<include file="nav:footer" />